From 529e9ac9f539aadd609aba8dd96d9d7704f1423b Mon Sep 17 00:00:00 2001 From: justbur Date: Sat, 6 Feb 2016 20:16:07 -0500 Subject: [PATCH] Add which-key-is-verbose Allows one to silence messages which may not indicate an error. --- which-key.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/which-key.el b/which-key.el index 7ddbfc98f42..cf58bfc303b 100644 --- a/which-key.el +++ b/which-key.el @@ -276,6 +276,11 @@ prefixes in `which-key-paging-prefixes'" 'which-key-use-C-h-commands "2015-12-2") +(defcustom which-key-is-verbose nil + "Whether to warn about potential mistakes in configuration." + :group 'which-key + :type 'boolean) + (defvar which-key-C-h-map (let ((map (make-sparse-keymap))) (dolist (bind '(("\C-a" . which-key-abort) @@ -650,8 +655,9 @@ bottom." (cond ((null alist) (list (cons keys value))) ((assoc-string keys alist) (when (not (string-equal (cdr (assoc-string keys alist)) value)) - (message "which-key: changing %s name from %s to %s in the %s alist" - key (cdr (assoc-string keys alist)) value alist-name) + (when which-key-is-verbose + (message "which-key: changing %s name from %s to %s in the %s alist" + key (cdr (assoc-string keys alist)) value alist-name)) (setcdr (assoc-string keys alist) value)) alist) (t (cons (cons keys value) alist))))) @@ -706,7 +712,8 @@ string." (let ((keys (key-description (kbd key-seq-str)))) (if (and (null force) (assoc-string keys which-key-prefix-title-alist)) - (message "which-key: Prefix title not added. A title exists for this prefix.") + (when which-key-is-verbose + (message "which-key: Prefix title not added. A title exists for this prefix.")) (push (cons keys title) which-key-prefix-title-alist)))) ;;;###autoload -- 2.30.2